package edu.mit.csail.relo.jdt.browse;

import org.eclipse.jface.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;

import edu.mit.csail.relo.ui.ReloAction;

public class ExportImageAction extends ReloAction {

	@Override
	public void run(IAction action) {
		FileDialog fd = new FileDialog(this.rc.getViewer().getControl()
				.getShell(), SWT.SAVE);
		fd.setFilterExtensions(new String[] { ".png", ".jpg", ".bmp" });
		fd.setText("File name to export as Image");
		fd.setFileName(rc.getDefaultFileName());
		String file = fd.open();
		if (file != null)
			rc.exportImage(file);
	}
}
